package admin

import (
	"app/api/handler/admin/user"
	"app/api/middleware"
	"github.com/gin-gonic/gin"
)

// admin组织的路由分组
func Router(router *gin.RouterGroup) {
	//实现管理员登陆
	router.POST("/Login", user.Login)

	//实现获取用户列表
	router.POST("/FindUser", middleware.AdminJwtTokenValid, user.FindUser)

	//实现获取头像
	router.POST("/GetHead", middleware.AdminJwtTokenValid, user.GetHead)

	//实现切换头像
	router.POST("/changeHead", middleware.AdminJwtTokenValid, user.ChangeHead)

	//实现获取今日信息
	router.POST("/getTodayInfo", middleware.AdminJwtTokenValid, user.GetTodayInfo)

	//实现获取今日商品排行
	router.POST("/getTodayGoodsRank", middleware.AdminJwtTokenValid, user.GetTodayGoods)

	//实现获取商品列表
	router.POST("/getGoodsList", middleware.AdminJwtTokenValid, user.GetGoodsList)

	//实现商品搜索
	router.POST("/searchGoods", middleware.AdminJwtTokenValid, user.SearchGoods)

	//实现获取商品详情页
	router.POST("/getGoodsDetail", middleware.AdminJwtTokenValid, user.GetGoodsDetail)

	//实现修改商品状态
	router.POST("/changeGoodsStatus", middleware.AdminJwtTokenValid, user.ChangeGoodsStatus)

	//获取所有待审核的商品
	router.POST("/getGoodsCheckList", middleware.AdminJwtTokenValid, user.GetPendingGoods)

	//获取所有订单信息
	router.POST("/getOrderList", middleware.AdminJwtTokenValid, user.GetOrderList)

	//通过订单ID获取订单信息
	router.POST("/getOrderByID", middleware.AdminJwtTokenValid, user.GetOrderByID)

	//通过订单ID实现订单详情页
	router.POST("/getOrderDetailByID", middleware.AdminJwtTokenValid, user.GetOrderDetailByID)

	//获取所有商家列表
	router.POST("/getSupplierList", middleware.AdminJwtTokenValid, user.GetSupplierList)

	//通过商家ID获取商家商品信息
	router.POST("/getSupplierByID", middleware.AdminJwtTokenValid, user.GetSupplierByID)

	//通过商家ID获取商家订单信息
	router.POST("/getSupplierOrder", middleware.AdminJwtTokenValid, user.GetSupplierOrder)

	//获取用户列表
	router.POST("/getUserList", middleware.AdminJwtTokenValid, user.GetUserList)

	//实现通过邮箱进行用户搜索
	router.POST("/searchUser", middleware.AdminJwtTokenValid, user.SearchUser)

	//实现用户修改状态
	router.POST("/changeUserStatus", middleware.AdminJwtTokenValid, user.ChangeUserStatus)
}
